import com.qiniu.util.Json;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wangzhanjin on 2018/5/14.
 */
public class Maintest {

    public static void main(String[] args) {

        Maintest maintest = new Maintest();
        maintest.listTest();
    }


    private void listTest(){
        List<Student> list = new ArrayList<>();
        List<Integer> listAge = new ArrayList<>();
        list.add(new Student("张三", 11));
        list.add(new Student("李四", 14));
        list.forEach(student -> listAge.add(student.age));
        System.out.println(listAge.toArray());

    }
    class Student{
        public String name;
        public Integer age;
        public Student(String name, Integer age) {
            this.name = name;
            this.age = age;
        }
    }

}
